﻿using IService;
using Microsoft.EntityFrameworkCore;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;

namespace Service
{
    public class JurisdictionService : IJurisdictionService
    {
        private JurisdictionDal _j;
        public JurisdictionService(JurisdictionDal j)
        {
            _j = j;
        }

        public Task<int> CreateAsync(Jurisdiction jurisdiction)
        {
            return _j.CreateAsync(jurisdiction);
        }

        public Task<int> DeleteAsync(int juriId)
        {
            return _j.DeleteAsync(juriId);
        }

        public Task<List<Jurisdiction>> GetAllAsync()
        {
            return _j.GetAllAsync();
        }

        public Task<List<Jurisdiction>> GetByGroupIdAsync(int groupId)
        {
            return _j.GetByGroupIdAsync(groupId);
        }

        public Task<Jurisdiction> GetByIdAsync(int juriId)
        {
            return _j.GetByIdAsync(juriId);
        }

        public Task<int> UpdateAsync(Jurisdiction jurisdiction)
        {
            return _j.UpdateAsync(jurisdiction);
        }
    }
}